package avicit.bdp.dds.api.service;

import avicit.bdp.common.base.BaseService;
import avicit.bdp.dds.dao.entity.ProcessDefinitionTemplate;
import avicit.bdp.dds.dao.mapper.ProcessDefinitionTemplateMapper;
import avicit.platform6.core.exception.BusinessException;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author mayanj
 */
@Service
public class ProcessDefinitionTemplateService extends BaseService<ProcessDefinitionTemplateMapper,
        ProcessDefinitionTemplate> {

    private static final Logger logger = LoggerFactory.getLogger(ProcessDefinitionTemplateService.class);


    /**
     * 根据任务类型查询模板列表
     *
     * @param	projectType
     * @return java.util.List<avicit.bdp.dds.dao.entity.ProcessDefinitionTemplate>
     *
     * @author felix
     * @date 2021/10/19 16:01
     */
    public List<ProcessDefinitionTemplate> getProcessTemplateList(String projectType) {
        if(StringUtils.isBlank(projectType)){
            throw new BusinessException("projectType，请检查参数！");
        }

        return this.mapper.getProcessTemplateList(projectType);
    }
}

